import request from '@/utils/request'

const api_name = '/product'

export default {
  getclassification(formData) {
    return request({
      url: `${api_name}/class`,
      method: 'post',
      data: formData
    })
  },
  deleteHospSet(id) {
    // eslint-disable-next-line no-irregular-whitespace
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },
  addclassification(name){
    return request({
      url: `${api_name}/add`,
      method: 'get',
      params: { name }
    })
  },
  getAllProduct(productInfo) {
    return request({
      url: `${api_name}/allproduct`,
      method: 'post',
      data: productInfo
    })
  },
  getclass() {
    return request({
      url: `${api_name}/getclass`,
      method: 'get'
    })
  },
  addproduct(productInfo) {
    return request({
      url: `${api_name}/addproduct`,
      method: 'post',
      data: productInfo
    })
  },
  deleteproduct(id) {
    return request({
      url: `${api_name}/removeproduct/${id}`,
      method: 'delete'
    })
  },
  getCount(formData) {
    return request({
      url: `${api_name}/getCount`,
      method: 'post',
      data: formData
    })
  }

}
